﻿@using Newtouch.Herp.Infrastructure.Model
@{
    ViewBag.Title = "切换库房";
    Layout = "~/Views/Shared/_Form.cshtml";
    var lt = (ViewBag.KfList as List<KfInfoModel>) ?? new List<KfInfoModel>();
}

<ul class="list-group">
    @foreach (KfInfoModel t in lt)
    {
        <li class="list-group-item" style="text-align: center;">
            <a data-id="@t.kfId" data-leve=@t.kfLeve style="width: 100%;display: block;cursor: pointer;">@t.kfName</a>
        </li>
    }
</ul>
<script type="text/javascript">
    $('li.list-group-item a').click(function () {
        SwithKf($(this).attr('data-id'), $(this).html(), $(this).attr('data-leve'));
    });

    function SwithKf(kfId, kfName, kfLeve) {
        $.najax({
            url: "/Home/SwithKf",
            data: { kfId: kfId, kfName: kfName, kfLeve: kfLeve },
            type: "post",
            dataType: "json",
            success: function (data) {
                top.top.location.href = top.top.location.href;
            }
        });
    }

</script>